<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-cf">待审核商会列表</div>
                </div>
                <div class="widget-body am-fr">
                   
                    <div class="am-scrollable-horizontal am-u-sm-12">
                        <table width="100%" class="am-table am-table-compact am-table-striped
                         tpl-table-black am-text-nowrap">
                            <thead>
                            <tr>
                                <th>商会ID</th>
                                <th>商会LOGO</th>
                                <th>商会名称</th>
                                <th>社团性质</th>
                                <th>所在地区</th>
                                <th>商会证件</th>
                                <th>联系人</th>
                                <th>身份</th>
                                <th>联系电话</th>
                                <th>身份证</th>
                                <th>更新时间</th>
                                <th>审核</th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php if (!$list->isEmpty()): foreach ($list as $item): ?>
                                <tr>
                                    <td class="am-text-middle"><?= $item['id'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= isset($item['logoImage']['file_path'])?$item['logoImage']['file_path']:'' ?>" title="点击查看大图" target="_blank">
                                            <img src="<?=  isset($item['logoImage']['file_path'])?$item['logoImage']['file_path']:'' ?>" height="72" alt="">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['name'] ?></td>
                                    <td class="am-text-middle"><?= $item['type'] ?></td>
                                    <td class="am-text-middle"><?= $item['area'] ?></td>
                                    <td class="am-text-middle">
                                        <a href="<?= isset($item['image']['file_path'])?$item['image']['file_path']:'' ?>" title="点击查看大图" target="_blank">
                                            <img src="<?=  isset($item['image']['file_path'])?$item['image']['file_path']:'' ?>" height="72" alt="">
                                        </a>
                                    </td>
                                    <td class="am-text-middle"><?= $item['contacts'] ?></td>
                                    <td class="am-text-middle"><?= $item['identity'] ?></td>
                                    <td class="am-text-middle"><?= $item['tel'] ?></td>
                                    <td class="am-text-middle"><?= $item['cardnumber'] ?></td>
                                    
                                    <td class="am-text-middle"><?= $item['update_time'] ?></td>

                                    <td class="am-text-middle">
                                        <div class="tpl-table-black-operation">
                                            <?php if (checkPrivilege('/edit')): ?>
                                                <a href="javascript:void(0);" class="item-edit" data-id="<?= $item['id'] ?>">
                                                    <i class="am-icon-pencil"></i> 通过
                                                </a>
                                            <?php endif; ?>
                                            <?php if (checkPrivilege('./delete')): ?>
                                                <a href="javascript:void(0);"
                                                   class="item-delete tpl-table-black-operation-del"
                                                   data-id="<?= $item['id'] ?>">
                                                    <i class="am-icon-trash"></i> 删除
                                                </a>
                                            <?php endif; ?>
                                        </div>
                                    </td>
                                </tr>
                            <?php endforeach; else: ?>
                                <tr>
                                    <td colspan="10" class="am-text-center">暂无记录</td>
                                </tr>
                            <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="am-u-lg-12 am-cf">
                        <div class="am-fr"><?= $list->render() ?> </div>
                        <div class="am-fr pagination-total am-margin-right">
                            <div class="am-vertical-align-middle">总记录：<?= $list->total() ?></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        // 删除
        var url = "<?= url('delete') ?>";
        $('.item-delete').delete('shanghui_id', url);
        // 通过
        var url = "<?= url('edit') ?>";
        $('.item-edit').click(function () {
            $.post(url,{shanghui_id:$(this).data('id')},
                function(data)
                {
                    if(data.code ==1){
                        // layer.alert('感叹号', { icon: 0, title: '提示' })
                        // layer.alert('对勾', { icon: 1, title: '提示' })
                        // layer.alert('红叉', { icon: 2, title: '提示' })
                        // layer.alert('问号', { icon: 3, title: '提示' })
                        // layer.alert('灰锁', { icon: 4, title: '提示' })
                        // layer.alert('红哭脸', { icon: 5, title: '提示' })
                        // layer.alert('绿笑脸', { icon: 6, title: '提示' })

                        layer.alert(data.msg, { icon: 6, title: '提示' },function(){
                            location.reload();
                        })

                    }  
                }
            )
        });
    });
</script>

